/*
 * THE SOURCE CODES OF THE SOFTWARE ARE VALUABLE ASSETS OF FIDUS TECHNOLOGIES LTD.
 * YOU AGREE TO KEEP ALL SOURCE CODES OF THE SOFTWARE IN CONFIDENCE. YOU MAY NOT TRANSFER
 * OR ASSIGN THE SOFTWARE OR YOUR RIGHTS UNDER THIS AGREEMENT.
 * LIMITED WARRANTY
 * THE SOFTWARE AND ACCOMPANYING WRITTEN MATERIALS (INCLUDING INSTRUCTIONS FOR USE) ARE PROVIDED "AS IS"
 * AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU ASSUME THE ENTIRE
 * RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE.
 * FIDUS TECHNOLOGIES DOES NOT WARRANT THAT THE SOFTWARE WILL MEET ALL YOUR REQUIREMENTS, THAT OPERATIONS
 * OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL SOFTWARE ERRORS WILL BE CORRECTED.
 * FIDUS TECHNOLOGIES-SOFTWARE SOLUTIONS IS NOT RESPONSIBLE FOR PROBLEMS CAUSED BY CHANGES IN THE
 * OPERATING CHARACTERISTICS OF COMPUTER HARDWARE OR COMPUTER OPERATING SYSTEMS WHICH ARE MADE AFTER
 * WHICH ARE MADE AFTER THE RELEASE OF THE SOFTWARE NOR FOR PROBLEMS IN THE INTERACTION OF THE SOFTWARE
 * WITH NON-FIDUS TECHNOLOGIES APPLICATION.WILL HAVE NO RESPONSIBILITY TO REPLACE OR REFUND THE LICENSE FEES
 * FOR MEDIA DAMAGED BY ACCIDENT, ABUSE OR MISAPPLICATION. THIS SOFTWARE IS INTENDED FOR COMMERCIAL,
 * INSTITUTIONAL, AND INDUSTRIAL USERS. THE ABOVE WARRANTIES ARE EXCLUSIVE AND IN LIEU OF ALL OTHER WARRANTIES,
 * WHETHER EXPRESSED OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE AND NON-INFRINGEMENT. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY FIDUS TECHNOLOGIES,
 * ITS EMPLOYEES, DISTRIBUTORS, DEALERS OR AGENTS SHALL INCREASE THE SCOPE OF THE ABOVE WARRANTIES OR
 * CREATE ANY NEW WARRANTIES. NEITHER FIDUS TECHNOLOGIES NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE
 * CREATION, PRODUCTION OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL
 * OR INCIDENTAL DAMAGES (INCLUDING DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS LOSSES, BUSINESS
 * INTERRUPTION, LOSS OF DATA, AND THE LIKE) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE,
 * OR ANY OTHER CLAIM BY ANY PARTY EVEN IF FIDUS TECHNOLOGIES HAS BEEN ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGES. IN THE EVENT FIDUS TECHNOLOGIES IS LIABLE FOR ANY DAMAGES, FIDUS TECHNOLOGIES' LIABILITY
 * FOR DAMAGES SHALL BE LIMITED TO THE AMOUNT PAID FOR THE SOFTWARE UNDER THE TERMS AND CONDITIONS OF THIS
 * AGREEMENT.
 * http://www.fidustechnologies.com
 * Copyright(C) 2010 FIDUS TECHNOLOGIES-Software Solutions(R)
 * All rights reserved.
 */

package com.fidus.inventory.beans.company;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mahesh Kedari<mahesh.kedari@fidustechnologies.com>
 */
@Entity
@Table(name = "Company_Details")
@NamedQueries({
    @NamedQuery(name = "CompanyDetails.findAll", query = "SELECT c FROM CompanyDetails c"),
    @NamedQuery(name = "CompanyDetails.findByCompanyID", query = "SELECT c FROM CompanyDetails c WHERE c.companyID = :companyID"),
    @NamedQuery(name = "CompanyDetails.findByCompanyName", query = "SELECT c FROM CompanyDetails c WHERE c.companyName = :companyName"),
    @NamedQuery(name = "CompanyDetails.findByCompanyLogo", query = "SELECT c FROM CompanyDetails c WHERE c.companyLogo = :companyLogo"),
    @NamedQuery(name = "CompanyDetails.findByStreetLine1", query = "SELECT c FROM CompanyDetails c WHERE c.streetLine1 = :streetLine1"),
    @NamedQuery(name = "CompanyDetails.findByStreetLine2", query = "SELECT c FROM CompanyDetails c WHERE c.streetLine2 = :streetLine2"),
    @NamedQuery(name = "CompanyDetails.findByCity", query = "SELECT c FROM CompanyDetails c WHERE c.city = :city"),
    @NamedQuery(name = "CompanyDetails.findByState", query = "SELECT c FROM CompanyDetails c WHERE c.state = :state"),
    @NamedQuery(name = "CompanyDetails.findByCountry", query = "SELECT c FROM CompanyDetails c WHERE c.country = :country"),
    @NamedQuery(name = "CompanyDetails.findByPincodeNumber", query = "SELECT c FROM CompanyDetails c WHERE c.pincodeNumber = :pincodeNumber"),
    @NamedQuery(name = "CompanyDetails.findByPhone1", query = "SELECT c FROM CompanyDetails c WHERE c.phone1 = :phone1"),
    @NamedQuery(name = "CompanyDetails.findByPhone2", query = "SELECT c FROM CompanyDetails c WHERE c.phone2 = :phone2"),
    @NamedQuery(name = "CompanyDetails.findByPhone3", query = "SELECT c FROM CompanyDetails c WHERE c.phone3 = :phone3"),
    @NamedQuery(name = "CompanyDetails.findByDescription", query = "SELECT c FROM CompanyDetails c WHERE c.description = :description")})
public class CompanyDetails implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Company_ID", nullable = false)
    private Short companyID;
    @Basic(optional = false)
    @Column(name = "CompanyName", nullable = false, length = 128)
    private String companyName;
    @Column(name = "CompanyLogo")
    private BigInteger companyLogo;
    @Basic(optional = false)
    @Column(name = "Street_Line1", nullable = false, length = 128)
    private String streetLine1;
    @Column(name = "Street_Line2", length = 128)
    private String streetLine2;
    @Column(name = "City", length = 64)
    private String city;
    @Column(name = "State", length = 64)
    private String state;
    @Column(name = "Country", length = 64)
    private String country;
    @Column(name = "Pincode_Number")
    private Integer pincodeNumber;
    @Basic(optional = false)
    @Column(name = "Phone1", nullable = false)
    private int phone1;
    @Column(name = "Phone2")
    private Integer phone2;
    @Column(name = "phone3")
    private Integer phone3;
    @Column(name = "Description", length = 256)
    private String description;
    @Column(name = "VAT_TIN_No", length = 64)
    private String vatTinNo;
    @Column(name = "CST_TIN_No", length = 64)
    private String cstTinNo;
    @Column(name = "MVAT_No", length = 64)
    private String matNo;
    @Column(name = "CST_No", length = 64)
    private String cstNo;

    public CompanyDetails() {
    }

    public CompanyDetails(Short companyID) {
        this.companyID = companyID;
    }

    public CompanyDetails(Short companyID, String companyName, String streetLine1, int phone1) {
        this.companyID = companyID;
        this.companyName = companyName;
        this.streetLine1 = streetLine1;
        this.phone1 = phone1;
    }

    public Short getCompanyID() {
        return companyID;
    }

    public void setCompanyID(Short companyID) {
        this.companyID = companyID;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public BigInteger getCompanyLogo() {
        return companyLogo;
    }

    public void setCompanyLogo(BigInteger companyLogo) {
        this.companyLogo = companyLogo;
    }

    public String getStreetLine1() {
        return streetLine1;
    }

    public void setStreetLine1(String streetLine1) {
        this.streetLine1 = streetLine1;
    }

    public String getStreetLine2() {
        return streetLine2;
    }

    public void setStreetLine2(String streetLine2) {
        this.streetLine2 = streetLine2;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Integer getPincodeNumber() {
        return pincodeNumber;
    }

    public void setPincodeNumber(Integer pincodeNumber) {
        this.pincodeNumber = pincodeNumber;
    }

    public int getPhone1() {
        return phone1;
    }

    public void setPhone1(int phone1) {
        this.phone1 = phone1;
    }

    public Integer getPhone2() {
        return phone2;
    }

    public void setPhone2(Integer phone2) {
        this.phone2 = phone2;
    }

    public Integer getPhone3() {
        return phone3;
    }

    public void setPhone3(Integer phone3) {
        this.phone3 = phone3;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCstNo() {
        return cstNo;
    }

    public void setCstNo(String cstNo) {
        this.cstNo = cstNo;
    }

    public String getCstTinNo() {
        return cstTinNo;
    }

    public void setCstTinNo(String cstTinNo) {
        this.cstTinNo = cstTinNo;
    }

    public String getMatNo() {
        return matNo;
    }

    public void setMatNo(String matNo) {
        this.matNo = matNo;
    }

    public String getVatTinNo() {
        return vatTinNo;
    }

    public void setVatTinNo(String vatTinNo) {
        this.vatTinNo = vatTinNo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (companyID != null ? companyID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompanyDetails)) {
            return false;
        }
        CompanyDetails other = (CompanyDetails) object;
        if ((this.companyID == null && other.companyID != null) || (this.companyID != null && !this.companyID.equals(other.companyID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return companyName;
    }

}
